-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs: Testing docs #9164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
docs: Testing docs #9164
Conversation
…ack to the visual
| export {installMouseEvent, installPointerEvent} from './testSetup'; | ||
| export {pointerMap} from './userEventMaps'; | ||
| export {User} from './user'; | ||
| export type {CheckboxGroupTester} from './checkboxgroup'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't have been released yet either, does that matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this I'm not going to put into the docs deploy. But in the final release these new testers will be made available so I'll merge that in then
|
This is DNM until the upcoming docs deploy is done |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
devongovett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Some suggestions on how to make the content a little less wordy. If you take them, make sure to apply to other component pages (and s2) as well.
| userEvent.click(document.activeElement); | ||
| ``` | ||
|
|
||
| ## Test setup and common gotchas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Test setup and common gotchas | |
| ## Test setup |
| If you are using fake timers in your test suite, be aware that you may need to advance your timers after various interactions. We have `requestAnimationFrame` calls in various underlying hooks that you will need to also handle by advancing your timers in the tests. | ||
| This happens most prominently in our collection components after selection. In Jest, this can be handled by calling `act(() => jest.runAllTimers());` but you may require more precise control | ||
| depending on the other time-sensitive behavior you are testing. Please see [Jest's timer docs](https://jestjs.io/docs/timer-mocks) or the equivalent docs of your test frameworks for more information on how to do so. | ||
| It is also a good idea to run all timers to completion after each test case to avoid any left over transitions or timeouts that a component may have setup during its lifecycle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite long. Maybe we can shorten it up a bit?
| If you are using fake timers in your test suite, be aware that you may need to advance your timers after various interactions. We have `requestAnimationFrame` calls in various underlying hooks that you will need to also handle by advancing your timers in the tests. | |
| This happens most prominently in our collection components after selection. In Jest, this can be handled by calling `act(() => jest.runAllTimers());` but you may require more precise control | |
| depending on the other time-sensitive behavior you are testing. Please see [Jest's timer docs](https://jestjs.io/docs/timer-mocks) or the equivalent docs of your test frameworks for more information on how to do so. | |
| It is also a good idea to run all timers to completion after each test case to avoid any left over transitions or timeouts that a component may have setup during its lifecycle. | |
| When using fake timers, you may need to advance timers after various interactions, e.g. after selection. In Jest, use `jest.runAllTimers()`. You should also run all timers after each test completes. See [Jest's timer docs](https://jestjs.io/docs/timer-mocks) or the equivalent docs of your test framework for more information. |
| }); | ||
| ``` | ||
|
|
||
| ### Simulating user long press |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Simulating user long press | |
| ### Simulating long press |
| Some components like Menu support long press operations. Unfortunately, the approach of using the userEvent library to simulate a press event and running timers to hit the | ||
| long press internal timer threshold isn't sufficient due to `useLongPress`'s usage of `PointerEvent` and our own detection of `virtual` vs `mouse`/`touch` pointer types. Mock [PointerEvent](https://github.com/adobe/react-spectrum/blob/16ff0efac57eebeb1cd601ab376ce7c58a4e4efd/packages/dev/test-utils/src/events.ts#L70-L103) | ||
| globally and use `fireEvent` from `@testing-library/react` to properly simulate these long press events in your tests. | ||
| If you are using Jest, you can call our <TypeLink links={testUtilDocs.links} type={testUtilDocs.exports.installPointerEvent} /> utility to automatically set up and tear down this mock in your test. | ||
| Additionally, if you are using fake timers and don't need to control the specific timings around the long press interaction, feel free to use our <TypeLink links={testUtilDocs.links} type={testUtilDocs.exports.triggerLongPress} /> utility as shown below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need all this explanation? Can we just tell people what to do?
| Some components like Menu support long press operations. Unfortunately, the approach of using the userEvent library to simulate a press event and running timers to hit the | |
| long press internal timer threshold isn't sufficient due to `useLongPress`'s usage of `PointerEvent` and our own detection of `virtual` vs `mouse`/`touch` pointer types. Mock [PointerEvent](https://github.com/adobe/react-spectrum/blob/16ff0efac57eebeb1cd601ab376ce7c58a4e4efd/packages/dev/test-utils/src/events.ts#L70-L103) | |
| globally and use `fireEvent` from `@testing-library/react` to properly simulate these long press events in your tests. | |
| If you are using Jest, you can call our <TypeLink links={testUtilDocs.links} type={testUtilDocs.exports.installPointerEvent} /> utility to automatically set up and tear down this mock in your test. | |
| Additionally, if you are using fake timers and don't need to control the specific timings around the long press interaction, feel free to use our <TypeLink links={testUtilDocs.links} type={testUtilDocs.exports.triggerLongPress} /> utility as shown below. | |
| To simulate a long press event in components like Menu, mock PointerEvent globally and use the `triggerLongPress` function from `@react-aria/test-utils`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, I'll keep the link to our installPointerEvents and triggerLongPress just so people know those utils are available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I guess the example right after imports those so people can infer from that
| import {fireEvent} from '@testing-library/react'; | ||
| import {installPointerEvent, triggerLongPress} from '@react-aria/test-utils'; | ||
| installPointerEvent(); | ||
|
|
||
| // In test case | ||
| let button = getByRole('button'); | ||
|
|
||
| // With fireEvent and specific timing control | ||
| fireEvent.pointerDown(el, {pointerType: 'touch'}); | ||
| act(() => jest.advanceTimersByTime(800)); | ||
| fireEvent.up(el, {pointerType: 'touch'}); | ||
|
|
||
| // With triggerLongPress | ||
| triggerLongPress(button); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the manual method? I think triggerLongPress takes an option to control the duration right?
| import {fireEvent} from '@testing-library/react'; | |
| import {installPointerEvent, triggerLongPress} from '@react-aria/test-utils'; | |
| installPointerEvent(); | |
| // In test case | |
| let button = getByRole('button'); | |
| // With fireEvent and specific timing control | |
| fireEvent.pointerDown(el, {pointerType: 'touch'}); | |
| act(() => jest.advanceTimersByTime(800)); | |
| fireEvent.up(el, {pointerType: 'touch'}); | |
| // With triggerLongPress | |
| triggerLongPress(button); | |
| import {installPointerEvent, triggerLongPress} from '@react-aria/test-utils'; | |
| installPointerEvent(); | |
| // In test case | |
| let button = getByRole('button'); | |
| triggerLongPress(button); |
| <ClassAPI links={testUtilDocs.links} class={testUtilDocs.exports.User} /> | ||
| <ClassAPI links={testUtilDocs.links} class={testUtilDocs.exports.CheckboxGroupTester} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <ClassAPI links={testUtilDocs.links} class={testUtilDocs.exports.User} /> | |
| <ClassAPI links={testUtilDocs.links} class={testUtilDocs.exports.CheckboxGroupTester} /> | |
| ### User | |
| <ClassAPI links={testUtilDocs.links} class={testUtilDocs.exports.User} /> | |
| ### CheckboxGroupTester | |
| <ClassAPI links={testUtilDocs.links} class={testUtilDocs.exports.CheckboxGroupTester} /> |
also do we need to repeat the User API on each test page? People can also refer to it in the testing guide if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats true but I felt it would be easier to have the information on each page so people didn't have to switch back and forth or if they found these testing pages via the search first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I do think we need the headings above the ClassAPIs. It's difficult to tell what the APIs are for on the rendered page, or that there's two different ones.
|
|
||
| ## Testing FAQ | ||
|
|
||
| <PatternTestingFAQ patternName="checkbox group" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this repeated on each page or added to the testing guide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same reasoning as the above, figured having all the info available on each page would help with discoverability
| [Timers](../testing.html#timers) | ||
|
|
||
| [Long press](../testing.html#simulating-user-long-press) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| [Timers](../testing.html#timers) | |
| [Long press](../testing.html#simulating-user-long-press) | |
| * [Timers](../testing.html#timers) | |
| * [Long press](../testing.html#simulating-user-long-press) |
| GridList features long press interactions on its items depending on the item actions provided and if the user is interacting with the gridlist on | ||
| a touch device. Please see the following sections in the general testing documentation for more information on how to handle these | ||
| behaviors in your test suite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| GridList features long press interactions on its items depending on the item actions provided and if the user is interacting with the gridlist on | |
| a touch device. Please see the following sections in the general testing documentation for more information on how to handle these | |
| behaviors in your test suite. | |
| GridList supports long press interactions on its items in certain configurations. See the following sections on how to handle these behaviors in your tests. |
| ## General setup | ||
|
|
||
| Tabs features automatic tab collapse behavior and may need specific mocks to test said behavior. | ||
| TODO: update this with what mocks are required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still todo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh thanks for catching this, I think i'll actually remove this section since collapsing shouldn't really be tested by the user IMO, thats on us to test
|
Build successful! 🎉 |
|
Build successful! 🎉 |
## API Changes
@react-aria/test-utils/@react-aria/test-utils:CheckboxGroupTester+CheckboxGroupTester {
+ checkboxes: Array<HTMLElement>
+ checkboxgroup: HTMLElement
+ constructor: (CheckboxGroupTesterOpts) => void
+ findCheckbox: ({
+ checkboxIndexOrText: number | string
+}) => HTMLElement
+ selectedCheckboxes: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleCheckbox: (TriggerCheckboxOptions) => Promise<void>
+}/@react-aria/test-utils:ComboBoxTester+ComboBoxTester {
+ close: () => Promise<void>
+ combobox: HTMLElement
+ constructor: (ComboBoxTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ focusedOption: HTMLElement | null
+ listbox: HTMLElement | null
+ open: (ComboBoxOpenOpts) => Promise<void>
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectOption: (ComboBoxSelectOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ trigger: HTMLElement
+}/@react-aria/test-utils:DialogTester+DialogTester {
+ close: () => Promise<void>
+ constructor: (DialogTesterOpts) => void
+ dialog: HTMLElement | null
+ open: (DialogOpenOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ trigger: HTMLElement
+}/@react-aria/test-utils:GridListTester+GridListTester {
+ cells: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ constructor: (GridListTesterOpts) => void
+ findRow: ({
+ rowIndexOrText: number | string
+}) => HTMLElement
+ gridlist: HTMLElement
+ rows: Array<HTMLElement>
+ selectedRows: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleRowSelection: (GridListToggleRowOpts) => Promise<void>
+ triggerRowAction: (GridListRowActionOpts) => Promise<void>
+}/@react-aria/test-utils:ListBoxTester+ListBoxTester {
+ constructor: (ListBoxTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ listbox: HTMLElement
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectedOptions: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleOptionSelection: (ListBoxToggleOptionOpts) => Promise<void>
+ triggerOptionAction: (ListBoxOptionActionOpts) => Promise<void>
+}/@react-aria/test-utils:MenuTester+MenuTester {
+ close: () => Promise<void>
+ constructor: (MenuTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ menu: HTMLElement | null
+ open: (MenuOpenOpts) => Promise<void>
+ openSubmenu: (MenuOpenSubmenuOpts) => Promise<MenuTester | null>
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectOption: (MenuSelectOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ submenuTriggers: Array<HTMLElement>
+ trigger: HTMLElement
+}/@react-aria/test-utils:RadioGroupTester+RadioGroupTester {
+ constructor: (RadioGroupTesterOpts) => void
+ findRadio: ({
+ radioIndexOrText: number | string
+}) => HTMLElement
+ radiogroup: HTMLElement
+ radios: Array<HTMLElement>
+ selectedRadio: HTMLElement | null
+ setInteractionType: (UserOpts['interactionType']) => void
+ triggerRadio: (TriggerRadioOptions) => Promise<void>
+}/@react-aria/test-utils:SelectTester+SelectTester {
+ close: () => Promise<void>
+ constructor: (SelectTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ listbox: HTMLElement | null
+ open: (SelectOpenOpts) => Promise<void>
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectOption: (SelectTriggerOptionOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ trigger: HTMLElement
+}/@react-aria/test-utils:TableTester+TableTester {
+ cells: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ columns: Array<HTMLElement>
+ constructor: (TableTesterOpts) => void
+ findCell: ({
+ text: string
+}) => HTMLElement
+ findRow: ({
+ rowIndexOrText: number | string
+}) => HTMLElement
+ rowGroups: Array<HTMLElement>
+ rowHeaders: Array<HTMLElement>
+ rows: Array<HTMLElement>
+ selectedRows: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ table: HTMLElement
+ toggleRowSelection: (TableToggleRowOpts) => Promise<void>
+ toggleSelectAll: ({
+ interactionType?: UserOpts['interactionType']
+}) => Promise<void>
+ toggleSort: (TableToggleSortOpts) => Promise<void>
+ triggerColumnHeaderAction: (TableColumnHeaderActionOpts) => Promise<void>
+ triggerRowAction: (TableRowActionOpts) => Promise<void>
+}/@react-aria/test-utils:TabsTester+TabsTester {
+ activeTabpanel: HTMLElement | null
+ constructor: (TabsTesterOpts) => void
+ findTab: ({
+ tabIndexOrText: number | string
+}) => HTMLElement
+ selectedTab: HTMLElement | null
+ setInteractionType: (UserOpts['interactionType']) => void
+ tablist: HTMLElement
+ tabpanels: Array<HTMLElement>
+ tabs: Array<HTMLElement>
+ triggerTab: (TriggerTabOptions) => Promise<void>
+}/@react-aria/test-utils:TreeTester+TreeTester {
+ cells: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ constructor: (TreeTesterOpts) => void
+ findRow: ({
+ rowIndexOrText: number | string
+}) => HTMLElement
+ rows: Array<HTMLElement>
+ selectedRows: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleRowExpansion: (TreeToggleExpansionOpts) => Promise<void>
+ toggleRowSelection: (TreeToggleRowOpts) => Promise<void>
+ tree: HTMLElement
+ triggerRowAction: (TreeRowActionOpts) => Promise<void>
+}@react-spectrum/test-utils/@react-spectrum/test-utils:CheckboxGroupTester+CheckboxGroupTester {
+ checkboxes: Array<HTMLElement>
+ checkboxgroup: HTMLElement
+ constructor: (CheckboxGroupTesterOpts) => void
+ findCheckbox: ({
+ checkboxIndexOrText: number | string
+}) => HTMLElement
+ selectedCheckboxes: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleCheckbox: (TriggerCheckboxOptions) => Promise<void>
+}/@react-spectrum/test-utils:ComboBoxTester+ComboBoxTester {
+ close: () => Promise<void>
+ combobox: HTMLElement
+ constructor: (ComboBoxTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ focusedOption: HTMLElement | null
+ listbox: HTMLElement | null
+ open: (ComboBoxOpenOpts) => Promise<void>
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectOption: (ComboBoxSelectOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ trigger: HTMLElement
+}/@react-spectrum/test-utils:DialogTester+DialogTester {
+ close: () => Promise<void>
+ constructor: (DialogTesterOpts) => void
+ dialog: HTMLElement | null
+ open: (DialogOpenOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ trigger: HTMLElement
+}/@react-spectrum/test-utils:GridListTester+GridListTester {
+ cells: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ constructor: (GridListTesterOpts) => void
+ findRow: ({
+ rowIndexOrText: number | string
+}) => HTMLElement
+ gridlist: HTMLElement
+ rows: Array<HTMLElement>
+ selectedRows: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleRowSelection: (GridListToggleRowOpts) => Promise<void>
+ triggerRowAction: (GridListRowActionOpts) => Promise<void>
+}/@react-spectrum/test-utils:ListBoxTester+ListBoxTester {
+ constructor: (ListBoxTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ listbox: HTMLElement
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectedOptions: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleOptionSelection: (ListBoxToggleOptionOpts) => Promise<void>
+ triggerOptionAction: (ListBoxOptionActionOpts) => Promise<void>
+}/@react-spectrum/test-utils:MenuTester+MenuTester {
+ close: () => Promise<void>
+ constructor: (MenuTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ menu: HTMLElement | null
+ open: (MenuOpenOpts) => Promise<void>
+ openSubmenu: (MenuOpenSubmenuOpts) => Promise<MenuTester | null>
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectOption: (MenuSelectOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ submenuTriggers: Array<HTMLElement>
+ trigger: HTMLElement
+}/@react-spectrum/test-utils:RadioGroupTester+RadioGroupTester {
+ constructor: (RadioGroupTesterOpts) => void
+ findRadio: ({
+ radioIndexOrText: number | string
+}) => HTMLElement
+ radiogroup: HTMLElement
+ radios: Array<HTMLElement>
+ selectedRadio: HTMLElement | null
+ setInteractionType: (UserOpts['interactionType']) => void
+ triggerRadio: (TriggerRadioOptions) => Promise<void>
+}/@react-spectrum/test-utils:SelectTester+SelectTester {
+ close: () => Promise<void>
+ constructor: (SelectTesterOpts) => void
+ findOption: ({
+ optionIndexOrText: number | string
+}) => HTMLElement
+ listbox: HTMLElement | null
+ open: (SelectOpenOpts) => Promise<void>
+ options: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ sections: Array<HTMLElement>
+ selectOption: (SelectTriggerOptionOpts) => Promise<void>
+ setInteractionType: (UserOpts['interactionType']) => void
+ trigger: HTMLElement
+}/@react-spectrum/test-utils:TableTester+TableTester {
+ cells: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ columns: Array<HTMLElement>
+ constructor: (TableTesterOpts) => void
+ findCell: ({
+ text: string
+}) => HTMLElement
+ findRow: ({
+ rowIndexOrText: number | string
+}) => HTMLElement
+ rowGroups: Array<HTMLElement>
+ rowHeaders: Array<HTMLElement>
+ rows: Array<HTMLElement>
+ selectedRows: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ table: HTMLElement
+ toggleRowSelection: (TableToggleRowOpts) => Promise<void>
+ toggleSelectAll: ({
+ interactionType?: UserOpts['interactionType']
+}) => Promise<void>
+ toggleSort: (TableToggleSortOpts) => Promise<void>
+ triggerColumnHeaderAction: (TableColumnHeaderActionOpts) => Promise<void>
+ triggerRowAction: (TableRowActionOpts) => Promise<void>
+}/@react-spectrum/test-utils:TabsTester+TabsTester {
+ activeTabpanel: HTMLElement | null
+ constructor: (TabsTesterOpts) => void
+ findTab: ({
+ tabIndexOrText: number | string
+}) => HTMLElement
+ selectedTab: HTMLElement | null
+ setInteractionType: (UserOpts['interactionType']) => void
+ tablist: HTMLElement
+ tabpanels: Array<HTMLElement>
+ tabs: Array<HTMLElement>
+ triggerTab: (TriggerTabOptions) => Promise<void>
+}/@react-spectrum/test-utils:TreeTester+TreeTester {
+ cells: ({
+ element?: HTMLElement
+}) => Array<HTMLElement>
+ constructor: (TreeTesterOpts) => void
+ findRow: ({
+ rowIndexOrText: number | string
+}) => HTMLElement
+ rows: Array<HTMLElement>
+ selectedRows: Array<HTMLElement>
+ setInteractionType: (UserOpts['interactionType']) => void
+ toggleRowExpansion: (TreeToggleExpansionOpts) => Promise<void>
+ toggleRowSelection: (TreeToggleRowOpts) => Promise<void>
+ tree: HTMLElement
+ triggerRowAction: (TreeRowActionOpts) => Promise<void>
+} |
same content as #9029, I pulled it out of the docs release since it refers to test utils that haven't been released yet
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project:
RSP